package br.edu.ufcg.msnlab2.grupo04.ChebHermLagueLege;

import br.edu.ufcg.msnlab2.InvalidFunctionException;
import br.edu.ufcg.msnlab2.misc.FunctionImpl;

public class Hermite {

	private static FunctionImpl funcao; 

	private static final double T[] = {0.00000000000000000000e+00,    1.22474487139158904909e+00};
	private static final double PESOS[] = {1.18163590060367735158e+00, 2.95408975150919337894e-01};

	public static double integralGaussHemite(String func) throws InvalidFunctionException {
		
		funcao = new FunctionImpl(func);
		
		return PESOS[1] * ( funcao.evaluate(T[1]) + funcao.evaluate(-T[1]) ) + PESOS[0] * funcao.evaluate(T[0]);
	}

}
